<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<title>菜单管理</title>
	<meta charset="utf-8">
	<th:block th:include="include :: header('commonFiles')" />
	<style type="text/css">
		html,body,.div-height100{
			height:100%;
		}
		.menu-tree{
			background: #ededed;
		}
	</style>
</head>

<body>
	<div class="layui-row div-height100">
		<div class="layui-row">
			<button type="button" class="layui-btn layui-btn-radius layui-btn-normal" onclick="add()">
				<i class="layui-icon">&#xe608;</i> 添加
			</button>
		</div>
		<div class="layui-col-xs3 layui-col-sm3 layui-col-md3 div-height100 menu-tree">
			<div id="menuTree"></div>
    	</div>
    	<div class="layui-col-xs9 layui-col-sm9 layui-col-md9 div-height100">
			<input type="hidden" id="id" name="id"/>
    		<form class="layui-form" id="menuForm">
    			
    			<input type="hidden" id="level" name="level"/>
    			<input type="hidden" id="seq" name="seq"/>
			
				<div class="layui-form-item">
					<label class="layui-form-label">父级菜单</label>
					<div class="layui-input-block">
						<select id="parentCode" name="parentCode" lay-filter="">
							<option value="0">根节点</option>
						</select>
					</div>
				</div>
			
				<div class="layui-form-item">
					<label class="layui-form-label">菜单名称</label>
					<div class="layui-input-block">
						<input type="text" id="menuName" name="menuName" required  lay-verify="menuName" placeholder="请输入菜单名称" autocomplete="off" class="layui-input">
					</div>
				</div>
		  
				<div class="layui-form-item">
					<label class="layui-form-label">菜单编号</label>
					<div class="layui-input-block">
						<input type="text" id="menuCode" name="menuCode" required  lay-verify="menuCode" placeholder="请输入菜单编号" autocomplete="off" class="layui-input">
					</div>
				</div>
		  
				<div class="layui-form-item">
					<label class="layui-form-label">菜单路径</label>
					<div class="layui-input-block">
						<input type="text" id="url" name="url" required  lay-verify="url" placeholder="请输入菜单路径" autocomplete="off" class="layui-input">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">状态</label>
					<div class="layui-input-block">
						<select id="menuStatus" name="menuStatus" lay-filter="">
							<option value="1">有效</option>
							<option value="0">无效</option>
						</select>
					</div>
				</div>
		
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="myForm">保存</button>
						<button class="layui-btn layui-btn-primary" type="button" id="delBtn" onclick="delMenu()">删除</button>
					</div>
				</div>
		  
			</form>
    	</div>
	</div>
</body>

<!-- th:inline="none" 双数组符号一起使用，在thymeleaf被认为是内联表达式,所以渲染错误，添加了th:inline="none"可以防止该问题 -->
<script type="text/javascript" th:inline="none" th:src="@{/js/menu/list.js}"></script>

</html>